-
-
Notifications
You must be signed in to change notification settings - Fork 833
Add banner configurable via module API #10321
Conversation
Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
Would be great to hear some feedback on this proposal. |
Could you please provide some feedback on this proposal? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a technical point of view, I believe this can be a bit leaner as the HTML structure already exists and could be re-used.
We would need a test validating that a banner can be injected in the page too
But more importantly this requires a product review
ModuleRunner.instance.invoke(BannerLifecycle.Banner, opts); | ||
if (opts.banner) { | ||
view = ( | ||
<div className="mx_MatrixChat_wrapper"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From an implementation point of view, I don't think we would need to add a wrapper as the banner could be slotted as a sibling of the MatrixChat
and the parent section id="matrixchat"
is a flex container that applies the same CSS that you declared for mx_MatrixChat_wrapper
.
I'd be advocating for a leaner HTML structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed implementation to place the Banner as a sibling of the mx_MatrixChat
. Had to update existing mx_MatrixChat_wrapper
with flex-direction: column
for the Banner to be shown on the top of Element.
I have created a PR to the module API with a suggestion to add the Banner: matrix-org/matrix-react-sdk-module-api#13
👋 Product here... Regular users would not see this? This is just available for power users & people running a fork..? |
Hello 👋 yes, nothing is changed for the regular users. This is intended to be used in custom Element deployments. Currently we have to fork Element and apply custom changes. With this change in place, we could write a module that will add the banner useful in our deployment. |
The product consideration here is one of bandwidth & maintenance, by adding this to the module API we have to ensure we don't break it and maintain it if someone else does |
Yes, comfortable with this. Thanks both! |
Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
@maheichyk can you update the code here and fix the tests? I would then have a look at your PRs. |
# Conflicts: # src/components/structures/LoggedInView.tsx
Another PR is created to element-web: element-hq/element-web#25537. It is based on ideas from this comment: #10321. Element web seems to be a better place for these changes, please have a look. |
Superseeded by element-hq/element-web#25537 |
Type: Enhancement
Related: https://github.com/matrix-org/matrix-react-sdk-module-api
This PR suggests to add possibility to configure a banner at the top of Element that is configurable via module API.
This could be used to show custom menu, widget toggle buttons or other information that makes sense in custom fork deployments.
There is no module API for that currently but could look like this:
Module demo that shows simply button in the banner:
And look the following:
Checklist
Here's what your changelog entry will look like:
✨ Features